from fileinput import filename
import imp
import os
list = os.listdir('./')
for list_sam in list:
    try:
        test =os.listdir(f'./{list_sam}')
        for te in test: 
            ls = te.endswith('mp4==========')
            le = te.endswith('flv==========')
            # print(ls)
            if ls:
                print(f"{te}文件是mp4")
                # see_video(f"./test/{list_sam}/{te}")
                res = te.split("==========")[0]
                os.rename(f'./{list_sam}/{te}',f'./{list_sam}/{res}')
                print("修改为：[ {} ]".format(res))
            elif le:
                print("{} 文件是flv".format(te))
                res = te.split("==========")[0]
                os.rename(f'./{list_sam}/{te}',f'./{list_sam}/{res}')
                print("修改为：[ {} ]".format(res))
    except:
        print("不是文件夹")